package entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Embeddable;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import javax.persistence.Entity;

@Entity
@Table(name = "Recetas")
@Embeddable
public class RecetaBD {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer idReceta;

	private String instrucciones;
	private Integer horasElaboracion;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(name = "idReceta")
	private List<ItemRecetaBD> ingredientes;

	public RecetaBD() {
	}

	public Integer getIdReceta() {
		return idReceta;
	}

	public void setIdReceta(Integer idReceta) {
		this.idReceta = idReceta;
	}

	public Integer getHorasElaboracion() {
		return horasElaboracion;
	}

	public void setHorasElaboracion(Integer horasElaboracion) {
		this.horasElaboracion = horasElaboracion;
	}

	public List<ItemRecetaBD> getIngredientes() {
		return ingredientes;
	}

	public void setIngredientes(List<ItemRecetaBD> ingredientes) {
		this.ingredientes = ingredientes;
	}

	public void setInstrucciones(String instrucciones) {
		this.instrucciones = instrucciones;
	}

	public String getInstrucciones() {
		return instrucciones;
	}

}
